package com.youdianstar.app.util

import com.youdianstar.app.entity.CodeEntity


/**
 * File: PhoneCodeComparator
 * Author: 82149 Create: 2021/9/28 11:17
 * Changes (from 2021/9/28)
 * --------------------------------------------------
 * description: 国家码对象比较
 * ---------------------------------------------------
 *
 */
class CodeComparator :Comparator<CodeEntity>{
    override fun compare(o1: CodeEntity, o2: CodeEntity): Int {
        if (o1.en == "@" || o2.en == "#") {
            return 1
        } else if (o1.en == "#" || o2.en == "@") {
            return -1
        } else {
            return o1.en.compareTo(o2.en)
        }
    }
}